package edu.wpi.first.wpilibj.templates.commands;

import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj.templates.OI;
import edu.wpi.first.wpilibj.templates.RobotMap;
import edu.wpi.first.wpilibj.templates.subsystems.DriveSubsystem;
import edu.wpi.first.wpilibj.templates.subsystems.PneumaticSwerve;
import edu.wpi.first.wpilibj.templates.subsystems.VisualTrackingSubsystem;

/**
 * The base for all commands. All atomic commands should subclass CommandBase.
 * CommandBase stores creates and stores each control system. To access a
 * subsystem elsewhere in your code in your code use CommandBase.exampleSubsystem
 * @author Author
 */
public abstract class CommandBase extends Command {

    public static OI oi;
    // Create a single static instance of all of your subsystems
    
    public static DriveSubsystem leftDrivetrain = 
            new DriveSubsystem("Left Drivetrain",
            RobotMap.LEFT_FORE_JAGUAR, 
            RobotMap.LEFT_MID_JAGUAR, 
            RobotMap.LEFT_REAR_JAGUAR);
    
    public static DriveSubsystem rightDrivetrain = 
            new DriveSubsystem("Right Drivetrain", 
            RobotMap.RIGHT_FORE_JAGUAR, 
            RobotMap.RIGHT_MID_JAGUAR, 
            RobotMap.RIGHT_REAR_JAGUAR);
    
    public static PneumaticSwerve swerveSubsystem = 
            new PneumaticSwerve("Swerve", 
            RobotMap.COMPRESSOR_PORT, 
            RobotMap.COMPRESSOR_RELAY_PORT, 
            RobotMap.DEPLOY_SOLENOID, 
            RobotMap.RETRACT_SOLENOID);
    
    public static VisualTrackingSubsystem camera = 
            new VisualTrackingSubsystem("Axis Camera");

    public static void init() {
        // This MUST be here. If the OI creates Commands (which it very likely
        // will), constructing it during the construction of CommandBase (from
        // which commands extend), subsystems are not guaranteed to be
        // yet. Thus, their requires() statements may grab null pointers. Bad
        // news. Don't move it.
        oi = new OI();

        // Show what command your subsystem is running on the SmartDashboard
        SmartDashboard.putData(leftDrivetrain);
    } // end init

    public CommandBase(String name) {
        super(name);
    } // end CommandBase String Constructor

    public CommandBase() {
        super();
    } // end CommandBase Default Constructor
    
} // end CommandBase
